/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author TimoR
 */
@Entity
@Table(name = "foren")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Foren.findAll", query = "SELECT f FROM Foren f"),
    @NamedQuery(name = "Foren.findById", query = "SELECT f FROM Foren f WHERE f.id = :id"),
    @NamedQuery(name = "Foren.findByThamount", query = "SELECT f FROM Foren f WHERE f.thamount = :thamount"),
    @NamedQuery(name = "Foren.findByAnamount", query = "SELECT f FROM Foren f WHERE f.anamount = :anamount"),
    @NamedQuery(name = "Foren.findByLastn", query = "SELECT f FROM Foren f WHERE f.lastn = :lastn"),
    @NamedQuery(name = "Foren.findByLastd", query = "SELECT f FROM Foren f WHERE f.lastd = :lastd")})
public class Foren implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "thamount")
    private Integer thamount;
    @Column(name = "anamount")
    private Integer anamount;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "lastn")
    private String lastn;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 22)
    @Column(name = "lastd")
    private String lastd;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 65535)
    @Column(name = "name")
    private String name;

    public Foren() {
    }

    public Foren(Integer id) {
        this.id = id;
    }

    public Foren(Integer id, String lastn, String lastd, String name) {
        this.id = id;
        this.lastn = lastn;
        this.lastd = lastd;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getThamount() {
        return thamount;
    }

    public void setThamount(Integer thamount) {
        this.thamount = thamount;
    }

    public Integer getAnamount() {
        return anamount;
    }

    public void setAnamount(Integer anamount) {
        this.anamount = anamount;
    }

    public String getLastn() {
        return lastn;
    }

    public void setLastn(String lastn) {
        this.lastn = lastn;
    }

    public String getLastd() {
        return lastd;
    }

    public void setLastd(String lastd) {
        this.lastd = lastd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Foren)) {
            return false;
        }
        Foren other = (Foren) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Foren[ id=" + id + " ]";
    }
    
}
